$(function () {
    var pushCourseList = [
        {id: 1, name: "花样足球", img: "../static/images/ysfx/ysfx_logo.png"},
        {id: 2, name: "花样手工", img: "../static/images/ysfx/11.png"},
        {id: 3, name: "机器人", img: "../static/images/ysfx/ysfx_logo.png"},
    ];
    // 五色花属性
    var flower = {
        maxFraction1: [10, 10, 10, 10, 10, 10, 10, 10],
        fractions1: [5, 5, 5, 5, 5, 5, 1, 5],
        colorList1: null,
        logoName1: "",
    }

    var img = new Image();
    img.src = "./img/ysfx_logo.png";
    // img.src = "";
    // createFlower(null, null, null, null, "", img, 5, 0.5);
    runFlower()
})
var option ={
    num : 5,
    speed : 0.5,
    img: new Image()
}
option.img.src = "./img/ysfx_logo.png";
function changeNum() {
    var num = $('input[name="num"]').val()
    if(num && num < 3){
        num = 3
        $('input[name="num"]').val(3)
    }
    option.num = num
    runFlower()
}

function changeV() {
    var speed = $('input[name="speed"]').val()
    if(speed && speed < 0 ){
        speed = 0
        $('input[name="speed"]').val(0)
    }else if(speed && speed > 50 ) {
        speed = 50
        $('input[name="speed"]').val(50)
    }
    option.speed = speed
    runFlower()
}

function runFlower() {
    createFlower(null, null, null, null, "", option.img, option.num, option.speed);
}


